package com.tfjybj.itoo.teach.provider.service.impl;

import com.dmsdbj.itoo.tool.base.service.impl.BaseServicePlusImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tfjybj.itoo.teach.entity.ProfessionDictionaryEntity;
import com.tfjybj.itoo.teach.model.ProfessionDictionaryModel;
import com.tfjybj.itoo.teach.provider.dao.ProfessionDictionaryDao;
import com.tfjybj.itoo.teach.provider.service.ProfessionDictionaryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ProfessionDictionaryService接口实现类
 * ${base}表
 *
 * @author 田成荣
 * @version 2.0.0
 * @since 2.0.0 2018-11-08 19:34:10
 */
@Service("professionDictionaryService")
public class ProfessionDictionaryServiceImpl extends BaseServicePlusImpl<ProfessionDictionaryDao, ProfessionDictionaryEntity> implements ProfessionDictionaryService {
	
	//region 模板生成
    @Resource
    private ProfessionDictionaryDao professionDictionaryDao;

	
	 @Override
    public PageInfo<ProfessionDictionaryEntity> queryByLikeProfessionName(String professionName, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(professionDictionaryDao.queryLikeProfessionName(professionName));
    }
	//endregion

    /* **********************************以下为非模板生成的内容********************************* */
    /**
     * 查询学科门类信息
     * @author 杨燕梅
     * @since 2.0.0 2018-11-18 15:39:31
     */
    @Override
    public List<ProfessionDictionaryModel>queryDiscipline(){
        return professionDictionaryDao.queryDiscipline();
    }

    /**
     *查询某一学科门类下所属专业类别（与学科门类级联）
     * @param professionCode 学科门类id
     * @author 杨燕梅
     * @since 2.0.0 2018-11-24 12:20:50
     */
    @Override
    public List<ProfessionDictionaryModel>queryMajorDisciplineByProfessionCode(String professionCode){
        return professionDictionaryDao.queryMajorDisciplineByProfessionCode(professionCode);
    }

    /**
     * 查询某一专业类别下所属专业名称（与专业类别级联）
     * @param professionCode 学科门类id
     * @author 杨燕梅
     * @since 2.0.0 2018-11-24 13:54:52
     */
    @Override
    public List<ProfessionDictionaryModel>queryProfessionNameByProfessionCode(String professionCode){
        return professionDictionaryDao.queryProfessionNameByProfessionCode(professionCode);
    }
}
